<!DOCTYPE html>
<html>
    <head>
        <title>jQuery隐藏/显示切换的应用</title>
        <meta charset="utf-8">
        <style>
            p {
                width: 100px;
                height: 100px;
                background-color: orange
            }
        </style>
        <script src="js/jquery-3.6.1.js"></script>
        <script>
            $(document).ready(function() {
                $("#toggle").click(function() {
                    $("p").toggle();
                });
            });
        </script>
    </head>
    <body>
        <h3>jQuery隐藏/显示切换的应用</h3>
        <hr>
        <button id="toggle" type="button">隐藏/显示切换</button>
        <p>测试段落</p>
    </body>
</html>